<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:t="http://myfaces.apache.org/tomahawk">

<f:view>
	<f:loadBundle var="messages" basename="messages" />

	<head>
	<title>#{messages['comentarioForm.title']}</title>
	<style type="text/css">
.jscalendar-DB-div-style {
	position: absolute;
	margin-top: -69px;
	margin-left: -408px;
}
</style>
	</head>

	<h:messages errorClass="error" layout="table" style="width: 100%" />

	<p>Please fill in comentario's information below:</p>

	<h:form id="comentarioForm">
		<h:inputHidden value="#{comentarioForm.comentario.id}">
			<f:convertNumber />
		</h:inputHidden>
		<h:panelGrid columns="3" styleClass="detail" columnClasses="label">



			<h:outputLabel value="Conteudo" for="conteudoTitulo" />
			<h:selectOneListbox id="conteudoTitulo" required="false" size="1"
				requiredMessage="Informe o Conteudo!"
				value="#{comentarioForm.conteudoId}">
				<f:selectItems value="#{comentarioForm.listaDeConteudos}" />
			</h:selectOneListbox>
			<br />

			<h:outputLabel for="name" value="#{messages['comentario.texto']}" />
			<h:inputTextarea value="#{comentarioForm.comentario.texto}"
				id="texto" />
			<h:message for="texto" styleClass="errorMessage" />

			<h:outputLabel for="dataPostagem"
				value="#{messages['comentario.dataPostagem']}" />
			<t:inputCalendar monthYearRowClass="yearMonthHeader"
				weekRowClass="weekHeader" id="dataPostagem"
				currentDayCellClass="currentDayCell" popupDateFormat="dd/MM/yyyy"
				value="#{comentarioForm.comentario.dataPostagem}"
				renderAsPopup="true" addResources="true" />
			<h:message for="dataPostagem" styleClass="errorMessage" />
			<h:inputHidden value="" />


	

			<h:panelGroup>
				<h:commandButton value="Save" action="#{comentarioForm.save}"
					id="save" styleClass="button" />
				<c:if test="${not empty comentarioForm.id}">
					<h:commandButton value="Delete" action="#{comentarioForm.delete}"
						id="delete" styleClass="button" />
				</c:if>
				<h:commandButton value="Cancel" action="cancel" immediate="true"
					id="cancel" styleClass="button" />
			</h:panelGroup>
			<h:inputHidden value="" />
		</h:panelGrid>
	</h:form>

	<script type="text/javascript">
	Form.focusFirstElement(document.forms['comentarioForm']);
</script>

</f:view>
</html>